package com.niubility.server.Impl;

import com.niubility.dao.SearchDao;
import com.niubility.entity.SearchMain;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.net.UnknownHostException;
import java.util.List;

@Service("searchServer")
public class SearchServer {
    @Resource
    private SearchDao searchDao;

    public boolean InsertInto(SearchMain searchMain)throws UnknownHostException{
        ////System.out.println("检索表成功！");
        return searchDao.Insert(searchMain) > 0?true:false;
    }

    public boolean Delete(SearchMain searchMain) throws  UnknownHostException{
        return searchDao.Delete(searchMain) > 0?true:false;
    }

    public boolean Update(SearchMain searchMain)throws Exception{
        return searchDao.Update(searchMain);
    }

    public List<Integer> Select(SearchMain searchMain)throws Exception{
        return searchDao.Select(searchMain);
    }

    public static void main(String[] args) throws Exception {
        SearchMain searchMain = new SearchMain();
        searchMain.setMaix("我在这里");
        SearchServer searchServer = new SearchServer();
        List list = searchServer.Select(searchMain);
        ////System.out.println(list);
    }
}
